

package com.idcos.enterprise.portal.dal.repository;

// auto generated imports

import java.util.List;

import com.idcos.enterprise.portal.dal.entity.PortalGroupRoleRel;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.idcos.cloud.core.dal.common.jpa.BaseRepository;

/**
 * 自动生成PortalGroupRoleRelRepository
 * <p>
 * 数据库配置文件自动生成,此文件属于自动生成的,具体可以参考codegen工程
 * Generated by <tt>jap-codgen</tt> on 2015-10-30 15:06:50.
 *
 * @author system-user
 * @version PortalGroupRoleRelRepository.java, v 1.1 2015-10-30 15:06:50 system-user Exp $
 */
public interface PortalGroupRoleRelRepository extends BaseRepository<PortalGroupRoleRel, String> {


    /**
     * <p>
     * The jql statement for this operation is <br>
     *
     * @param roleId
     * @return List<PortalGroupRoleRel>
     */
    public List<PortalGroupRoleRel> findByRoleId(String roleId);


    /**
     * <p>
     * The jql statement for this operation is <br>
     *
     * @param groupId
     * @return List<PortalGroupRoleRel>
     */
    public List<PortalGroupRoleRel> findByGroupId(String groupId);


    /**
     * <p>
     * The jql statement for this operation is <br>
     * <tt>delete from PortalGroupRoleRel t where t.groupId = ?1 and t.roleId = ?2</tt>
     *
     * @param groupId
     * @param roleId
     * @return int
     */
    @Query("delete from PortalGroupRoleRel t where t.groupId = ?1 and t.roleId = ?2")
    @Modifying
    public int deleteByGroupIdAndRoleId(String groupId, String roleId);

}